package com.rjxy.plansystemmanagement.service.impl;

import com.rjxy.plansystemmanagement.entity.FlightInformation;
import com.rjxy.plansystemmanagement.mapper.FlightMapper;
import com.rjxy.plansystemmanagement.service.FlightServie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FlightServiceImpl implements FlightServie {
    @Autowired
    private FlightMapper flightMapper;

    /**
     * 查询所有航班
     * @return
     */
    @Override
    public List<FlightInformation> list() {
        return flightMapper.list();
    }

    /**
     * 根据id删除指定航班
     * @param id
     */
    @Override
    public void deleteFlight(Integer id) {
        flightMapper.deleteFlight(id);
    }

    /**
     * 增加航班
     * @param flightInformation
     */
    @Override
    public void addFlight(FlightInformation flightInformation) {
        flightMapper.addFlight(flightInformation);
    }

    @Override
    public FlightInformation getFlightById(Integer id) {
        return flightMapper.getFlihtById(id);
    }

    @Override
    public void updateFlight(FlightInformation flightInformation) {
        flightMapper.updateFlight(flightInformation);
    }

    @Override
    public List<FlightInformation> getFlightByCFCityAndDDCity(String cfCity, String ddCity) {
        return flightMapper.getFlightByCFCityAndDDCity(cfCity,ddCity);
    }
}
